# Maintainer: Chocobo1

_realname=zopfli
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.1
pkgrel=1
arch=('any')
pkgdesc="A compression library programmed in C to perform very good, but slow, deflate or zlib compression (mingw-w64)"
url="https://github.com/google/zopfli"
license=('Apache')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
source=("https://github.com/google/zopfli/archive/${_realname}-${pkgver}.tar.gz")
sha256sums=('29743d727a4e0ecd1b93e0bf89476ceeb662e809ab2e6ab007a0b0344800e9b4')


build() {
  cd "${_realname}-${_realname}-${pkgver}"

  make zopfli
  make zopflipng
}

package() {
  cd "${_realname}-${_realname}-${pkgver}"

  mkdir -p "${pkgdir}${MINGW_PREFIX}/bin"
  install -m755 "zopfli" "zopflipng" "${pkgdir}${MINGW_PREFIX}/bin"
  install -Dm644 "COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING"
}
